home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
NBC Slam Jams!
/
NBC Slam Jams!.iso
/
xtras
/
media_la
/
fx_set_1.fxm
/
00131_Script_Text List
< prev
next >
Wrap
Text File
|
1998-01-20
|
2KB
|
70 lines
property pElementList, pFieldName, pFieldSprite, pCurActive
on new me, proplist
set pElementList = getAProp(proplist,#list)
set pFieldName = getAProp(proplist,#textField)
set pFieldSprite = getAProp(proplist,#textSprite)
set pCurActive = getAProp(proplist,#cur)
if not integerP(pCurActive) then put getPos(pElementList,pCurActive) into pCurActive
populateList(me)
set the lineHeight of field pFieldName = the lineHeight of field pFieldName
if count(pElementList) > 0 then setActive(me,pCurActive)
else setActive(me,0)
return me
end
on populateList me
put "" into text
repeat with i = 1 to count(pElementList)
put string(getAt(pElementList,i)) into line i of text
end repeat
put text into field pFieldName
end
on setActive me, c
if not integer(c) then
put getPos(pElementList,c) into c
end if
if c >= 0 then
set pCurActive = c
if c = 1 then put 1 into c1
else put the number of chars in line 1 to (c-1) of field pFieldName + 2 into c1
put the number of chars in line 1 to c of field pFieldName + 1 into c2
hilite char c1 to c2 of field pFieldName
end if
-- puppetSprite pHiliteSprite, TRUE
-- if pCurActive < 1 then
-- set the locV of sprite pHiliteSprite = -1000
-- else
-- put the rect of sprite pHiliteSprite into rec
-- put the lineHeight of field pFieldName into h
-- put the top of sprite pFieldSprite into th
-- set top = h*(pCurActive-1)+th+1-the scrolltop of member pFieldName
-- set bot = h*(pCurActive)+th+3-the scrolltop of member pFieldName
-- set top = max(top, th)
-- set bot = min(bot, the bottom of sprite pFieldSprite)
-- set the top of rec = top
-- set the bottom of rec = bot
-- set the rect of sprite pHiliteSprite = rec
-- end if
end
on drag me
repeat while the stillDown
fieldClick(me,the mouseLine)
end repeat
return pCurActive
end
on fieldClick me, c
if c > count(pElementList) then put count(pElementList) into c
setActive(me,c)
end